import 'dart:convert';

List<TeacherDto> teacherDtoFromJson(String str) =>
    List<TeacherDto>.from(json.decode(str).map((x) => TeacherDto.fromJson(x)));

String teacherDtoToJson(List<TeacherDto> data) =>
    json.encode(List<dynamic>.from(data.map((x) => x.toJson())));

class TeacherDto {
  TeacherDto(
      {this.id, this.userName, this.firstName, this.lastName, this.classIds});

  String? id;
  String? userName;
  String? firstName;
  String? lastName;
  List<String>? classIds;

  factory TeacherDto.fromJson(Map<String, dynamic> json) => TeacherDto(
        id: json["id"],
        userName: json["userName"],
        firstName: json["firstName"],
        lastName: json["lastName"],
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "userName": userName,
        "firstName": firstName,
        "lastName": lastName,
        "classIds": classIds != null
            ? List<dynamic>.from(classIds!.map((x) => x))
            : null,
      };
}
